package com.bgs.controller;


import com.bgs.common.R;
import com.bgs.service.MenusService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * <p>
 * 导航表 前端控制器
 * </p>
 *
 * @author Asia
 * @since 2021-09-14
 */
@RestController
@RequestMapping("/bgs/menus")
public class MenusController {
    @Autowired
    private MenusService service;

    @GetMapping("queryAuthByUserRole")
    @ApiOperation("根据用户角色查询对应的权限")
    public R queryAuthByUserRole(HttpServletRequest request) {
        return service.queryAuthByUserRole(request);
    }
    @GetMapping("/findMenu")
    public R findMenu(){
        return service.findMenu();
    }

    /**
     * 查询权限
     * @return
     */
    @GetMapping("/fourQueryMenu")
    R fourQueryMenu(){
       return service.fourQueryMenu();
    }

    @PostMapping("/fourEditMenu")
    R fourEditMenu(@RequestBody Map<String,Object> map){
        return service.fourEditMenu(map);
    }
}

